angular.module('faApp')
.service('faService', [ 'ajaxService',function (ajaxService) {
  this.faList = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_LIST"),cfg || {});
  }; 
  
  this.faQuery = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_QUERY"),cfg || {});
  };
  this.faShopQuery = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_SHOPQUERY"),cfg || {});
  };
  
  this.certQuery = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_QUERY_CERT"),cfg || {});
  };
 
  this.certSave = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_UPDATE_CERT"),cfg || {});
  };

  this.shopCertSave = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_UPDATE_SHOPCERT"),cfg || {});
  };
 
  this.certSaveImg = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_UPDATE_CERTIMG"),cfg || {});
  };
 
  this.blackAdd = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_BLACK_ADD"),cfg || {});
  }; 
 
  this.blackQuery = function (id) {
    return ajaxService.post(ajaxService.getApiUri("FA_BLACK_QUERY"),{userId:id});
  }; 
 
  this.blackList = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_BLACK_LIST"),cfg || {});
  }; 
  
  this.sbdstat = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_SBDSTAT"),cfg || {});
  }; 
 
  this.sbddetail = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("FA_SBDLIST"),cfg || {});
  }; 
 
  this.faUserVisit = function (id) {
    return ajaxService.post(ajaxService.getApiUri("FA_USER_VISIT"),{faId : id});
  }; 

  this.faUserVisitAdd = function (visit) {
    return ajaxService.post(ajaxService.getApiUri("FA_USER_VISIT_ADD"), visit || {});
  }; 
  this.faUserVisitDetailAdd = function (visit) {
    return ajaxService.post(ajaxService.getApiUri("FA_USER_VISIT_DETAIL_ADD"), visit || {});
  }; 

  this.faUserVisitUpdate = function (visit) {
    return ajaxService.post(ajaxService.getApiUri("FA_USER_VISIT_UPDATE"), visit || {});
  }; 

  this.markFaUser = function (id) {
    return ajaxService.post(ajaxService.getApiUri("FA_MARK_FA_USER"),{companyId : id});
  }; 

  this.sanfangQuery = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("SANFANG_QUERY"), cfg || {});
  };

  this.sanfangUpdate = function (sf) {
    return ajaxService.post(ajaxService.getApiUri("SANFANG_UPDATE"), sf || {});
  };

  this.sanfangAdd = function (sf) {
    return ajaxService.post(ajaxService.getApiUri("SANFANG_ADD"), sf || {});
  };

  this.sanfangDelete = function (id) {
    return ajaxService.post(ajaxService.getApiUri("SANFANG_DELETE"), {tpCompanyId: id} );
  };
  //查询机构
  this.jigouQuery = function(cfg){
    return ajaxService.post(ajaxService.getApiUri("JIGOU_QUERY"), cfg || {});
  }
  this.downLineList = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("DOWNLINE_LIST"), cfg || {} );
  };
  this.downLineDetail = function (id) {
    return ajaxService.post(ajaxService.getApiUri("DOWNLINE_DETAIL"), {id: id} );
  };
  this.downLineAdd = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("DOWNLINE_ADD"), cfg || {} );
  };
  this.downLineUpdata = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("DOWNLINE_UPDATA"), cfg || {} );
  };
  this.downLineUpFile = function (path) {
    return ajaxService.post(ajaxService.getApiUri("DOWNLINE_UPFILE"),  {path : path} );
  };
  this.downLineUpFileload = function (path) {
    return ajaxService.post(ajaxService.getApiUri("DOWNLINE_UPFILE_TU"),  {path : path} );
  };

  this.revisiitTask = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("REVISIITTASK"),cfg || {});
  };
  //查询注册来源活动
  this.queryActSource = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("QUERYACTSOURCE"),cfg || {});
  };

//内部理财师汇总数据列表
  this.lcsmanList = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("LCS_MAN_STATICTICS_LIST"), cfg || {});
  };
// 查询内部理财师详情列表
  this.lcsmanDetailList = function (cfg) {
    return ajaxService.post(ajaxService.getApiUri("LCS_MAN_DETAIL_LIST"), cfg || {});
  };
}]);